package avicit.bdp.dms.tdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.bdp.core.constant.Constants;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.LogField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

@ApiModel(value = "BdpAssetDTO", description = "数据资产信息")
@Table(name = "bdp_asset")
public class BdpAssetDTO extends BaseDTO {
  private static final long serialVersionUID = 1L;

  /** 主键ID */
  @LogField
  @ApiModelProperty(value = "主键")
  @FieldRemark(column = "id", field = "id", name = "主键")
  @Column(name = "id")
  @avicit.platform6.core.annotation.log.Id
  @javax.persistence.Id
  private String id;

  /** 数据资产名称 */
  @LogField
  @ApiModelProperty(value = "数据资产名称", name = "name")
  @FieldRemark(column = "name", field = "name", name = "数据资产名称")
  private String name;

  /** 数据资产编码 */
  @LogField
  @ApiModelProperty(value = "数据资产编码", name = "code")
  @FieldRemark(column = "code", field = "code", name = "数据资产编码")
  private String code;

  /** 数据资产目录ID */
  @LogField
  @ApiModelProperty(value = "数据资产目录ID", name = "catalogId")
  @FieldRemark(column = "catalog_id", field = "catalogId", name = "数据资产目录ID")
  private String catalogId;

  @ApiModelProperty(value = "数据资产目录", name = "catalogName")
  private transient String catalogName;

  /** 数据资产版本 */
  @ApiModelProperty(value = "数据资产版本", name = "assetVersion")
  @FieldRemark(column = "asset_version", field = "assetVersion", name = "数据资产版本")
  private String assetVersion;

  /** 状态 */
  @LogField
  @ApiModelProperty(value = "状态", name = "status")
  @FieldRemark(column = "status", field = "status", name = "状态")
  private Integer status;

  /** 资源提供方部门ID */
  @LogField
  @ApiModelProperty(value = "资源提供方部门ID", name = "departmentId")
  @FieldRemark(column = "department_id", field = "departmentId", name = "资源提供方部门ID")
  private String departmentId;

  /** 项目空间ID */
  @LogField
  @ApiModelProperty(value = "项目空间ID", name = "projectId")
  @FieldRemark(column = "project_id", field = "projectId", name = "项目空间ID")
  private String projectId;

  /** 发布范围 */
  @LogField
  @ApiModelProperty(value = "发布范围", name = "releaseScope")
  @FieldRemark(column = "release_scope", field = "releaseScope", name = "发布范围")
  private String releaseScope;

  /** 有效时间类型[1-时限/2-长期] */
  @LogField
  @ApiModelProperty(value = "有效时间类型[1-时限/2-长期]", name = "effectiveTimeType")
  @FieldRemark(
      column = "effective_time_type",
      field = "effectiveTimeType",
      name = "有效时间类型[1-时限/2-长期]")
  private Integer effectiveTimeType;

  /** 有效时间开始时间 */
  @ApiModelProperty(value = "有效时间开始时间", name = "effectiveTimeStart")
  @FieldRemark(column = "effective_time_start", field = "effectiveTimeStart", name = "有效时间开始时间")
  @JsonFormat(timezone = "GMT+8", pattern = Constants.YYYY_MM_DD)
  private Date effectiveTimeStart;

  /** 有效时间结束时间 */
  @ApiModelProperty(value = "有效时间结束时间", name = "effectiveTimeEnd")
  @FieldRemark(column = "effective_time_end", field = "effectiveTimeEnd", name = "有效时间结束时间")
  @JsonFormat(timezone = "GMT+8", pattern = Constants.YYYY_MM_DD)
  private Date effectiveTimeEnd;

  /** 标签 */
  @ApiModelProperty(value = "标签", name = "labels")
  @FieldRemark(column = "labels", field = "labels", name = "标签")
  private String labels;

  /** 标签 */
  @ApiModelProperty(value = "开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表]", name = "openServiceType")
  @FieldRemark(column = "open_service_type", field = "openServiceType", name = "开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表]")
  private String openServiceType;

  /** 共享类型[1-公开/2-需申请] */
  @LogField
  @ApiModelProperty(value = "共享类型[1-公开/2-需申请]", name = "shareType")
  @FieldRemark(column = "share_type", field = "shareType", name = "共享类型[1-公开/2-需申请]")
  private String shareType;

  /** 资源类型[1-数据服务/2-模型/3-文档/4-报表分析] */
  @LogField
  @ApiModelProperty(value = "资源类型[1-数据服务/2-模型/3-文档/4-报表分析]", name = "assetType")
  @FieldRemark(column = "asset_type", field = "assetType", name = "资源类型")
  private String assetType;

  /** 来源系统 */
  @ApiModelProperty(value = "来源系统", name = "sourceSystem")
  @FieldRemark(column = "source_system", field = "sourceSystem", name = "来源系统")
  private String sourceSystem;

  /** 备注 */
  @ApiModelProperty(value = "备注", name = "remark")
  @FieldRemark(column = "remark", field = "remark", name = "备注")
  private String remark;

  /** 其他 */
  @ApiModelProperty(value = "其他", name = "other")
  @FieldRemark(column = "other", field = "other", name = "其他")
  private String other;

  /** 变更说明 */
  @ApiModelProperty(value = "变更说明", name = "changeDescription")
  @FieldRemark(column = "change_description", field = "changeDescription", name = "变更说明")
  private String changeDescription;

  /** 发布标题 */
  @ApiModelProperty(value = "发布标题", name = "releaseTitle")
  @FieldRemark(column = "release_title", field = "releaseTitle", name = "发布标题")
  private String releaseTitle;

  /** 发布日期 */
  @JsonFormat(timezone = "GMT+8", pattern = Constants.YYYY_MM_DD)
  @ApiModelProperty(value = "发布日期", name = "releaseDate")
  @FieldRemark(column = "release_date", field = "releaseDate", name = "发布日期")
  private Date releaseDate;

  /** 发布人 */
  @ApiModelProperty(value = "发布人", name = "releaser")
  @FieldRemark(column = "releaser", field = "releaser", name = "发布人")
  private String releaser;

  /** 发布方 */
  @ApiModelProperty(value = "发布方", name = "releaseDept")
  @FieldRemark(column = "release_dept", field = "releaseDept", name = "发布方")
  private String releaseDept;

  /** 发布状态，1：已发布，0：未发布 */
  @ApiModelProperty(value = "发布状态", name = "releaseStatus")
  @FieldRemark(column = "release_status", field = "releaseStatus", name = "发布状态")
  private Integer releaseStatus;

  /** 审核状态 */
  @ApiModelProperty(value = "审核状态", name = "checkerStatus")
  @FieldRemark(column = "checker_status", field = "checkerStatus", name = "审核状态")
  private Integer checkerStatus;

  /** 编辑状态 */
  @ApiModelProperty(value = "编辑状态", name = "editStatus")
  @FieldRemark(column = "edit_status", field = "editStatus", name = "编辑状态")
  private String editStatus;

  /** 查看次数*/
  @ApiModelProperty(value = "查看次数", name = "viewCount")
  @FieldRemark(column = "view_count", field = "viewCount", name = "查看次数")
  private Long viewCount;

  /** 访问次数 */
  @ApiModelProperty(value = "访问次数", name = "callCount")
  @FieldRemark(column = "call_count", field = "callCount", name = "访问次数")
  private Long callCount;

  @Column(name = "secret_level")
  protected String secretLevel;

  @LogField private transient String secretLevelName;

  @LogField private transient String labelNames;

  /***
   * 创建人
   */
  private transient String createdName;
  /** 流程状态 */
  private transient String dbid_;
  /** 节点中文名称 */
  private transient String activityalias_;

  private transient String activityname_;

  private transient String businessstate_;

  /** 流程帽子表ID */
  private transient String processId;

  /** 需求响应流程ID */
  private transient String replyProcessId;

  private transient String assetTypeName;
  private transient String shareTypeName;
  private transient String sourceSystemName;
  private transient String releaserName;
  private transient String releaseScopeShowName;

  /** 申请按钮 1：显示，0：隐藏 */
  private transient String applyButton;
  private transient String queryButton;
  private transient String pushButton;
  private transient String apiButton;
  private transient String downloadButton;
  private transient String modelButton;
  private transient String reportButton;
  private transient String effectiveTimeTypeStr;
  private transient String reportUrl;
  private transient String createDeptName;
  private transient String releaseDeptName;

  //private transient String openServiceType;
  private transient String openServiceTypeName;
  private transient String checkerStatusName;

  public String getCheckerStatusName() {
    return checkerStatusName;
  }

  public void setCheckerStatusName(String checkerStatusName) {
    this.checkerStatusName = checkerStatusName;
  }

  public String getOpenServiceType() {
    return openServiceType;
  }

  public void setOpenServiceType(String openServiceType) {
    this.openServiceType = openServiceType;
  }

  public String getOpenServiceTypeName() {
    return openServiceTypeName;
  }

  public void setOpenServiceTypeName(String openServiceTypeName) {
    this.openServiceTypeName = openServiceTypeName;
  }

  public String getApplyButton() {
    return applyButton;
  }

  public void setApplyButton(String applyButton) {
    this.applyButton = applyButton;
  }

  public String getQueryButton() {
    return queryButton;
  }

  public void setQueryButton(String queryButton) {
    this.queryButton = queryButton;
  }

  public String getPushButton() {
    return pushButton;
  }

  public void setPushButton(String pushButton) {
    this.pushButton = pushButton;
  }

  public String getApiButton() {
    return apiButton;
  }

  public void setApiButton(String apiButton) {
    this.apiButton = apiButton;
  }

  public String getDownloadButton() {
    return downloadButton;
  }

  public void setDownloadButton(String downloadButton) {
    this.downloadButton = downloadButton;
  }

  public String getModelButton() {
    return modelButton;
  }

  public void setModelButton(String modelButton) {
    this.modelButton = modelButton;
  }

  public String getReportButton() {
    return reportButton;
  }

  public void setReportButton(String reportButton) {
    this.reportButton = reportButton;
  }

  public String getReleaseDept() {
    return releaseDept;
  }

  public void setReleaseDept(String releaseDept) {
    this.releaseDept = releaseDept;
  }

  public String getReleaserName() {
    return releaserName;
  }

  public void setReleaserName(String releaserName) {
    this.releaserName = releaserName;
  }

  public String getShareTypeName() {
    return shareTypeName;
  }

  public void setShareTypeName(String shareTypeName) {
    this.shareTypeName = shareTypeName;
  }

  public String getAssetTypeName() {
    return assetTypeName;
  }

  public void setAssetTypeName(String assetTypeName) {
    this.assetTypeName = assetTypeName;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getCatalogId() {
    return catalogId;
  }

  public void setCatalogId(String catalogId) {
    this.catalogId = catalogId;
  }

  public String getAssetVersion() {
    return assetVersion;
  }

  public void setAssetVersion(String assetVersion) {
    this.assetVersion = assetVersion;
  }

  public Integer getStatus() {
    return status;
  }

  public void setStatus(Integer status) {
    this.status = status;
  }

  public String getDepartmentId() {
    return departmentId;
  }

  public void setDepartmentId(String departmentId) {
    this.departmentId = departmentId;
  }

  public String getReleaseScope() {
    return releaseScope;
  }

  public void setReleaseScope(String releaseScope) {
    this.releaseScope = releaseScope;
  }

  public Integer getEffectiveTimeType() {
    return effectiveTimeType;
  }

  public void setEffectiveTimeType(Integer effectiveTimeType) {
    this.effectiveTimeType = effectiveTimeType;
  }

  public Date getEffectiveTimeStart() {
    return effectiveTimeStart;
  }

  public void setEffectiveTimeStart(Date effectiveTimeStart) {
    this.effectiveTimeStart = effectiveTimeStart;
  }

  public Date getEffectiveTimeEnd() {
    return effectiveTimeEnd;
  }

  public void setEffectiveTimeEnd(Date effectiveTimeEnd) {
    this.effectiveTimeEnd = effectiveTimeEnd;
  }

  public String getLabels() {
    return labels;
  }

  public void setLabels(String labels) {
    this.labels = labels;
  }

  public String getShareType() {
    return shareType;
  }

  public void setShareType(String shareType) {
    this.shareType = shareType;
  }

  public String getAssetType() {
    return assetType;
  }

  public void setAssetType(String assetType) {
    this.assetType = assetType;
  }

  public String getSourceSystem() {
    return sourceSystem;
  }

  public void setSourceSystem(String sourceSystem) {
    this.sourceSystem = sourceSystem;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public String getOther() {
    return other;
  }

  public void setOther(String other) {
    this.other = other;
  }

  public String getChangeDescription() {
    return changeDescription;
  }

  public void setChangeDescription(String changeDescription) {
    this.changeDescription = changeDescription;
  }

  public String getCatalogName() {
    return catalogName;
  }

  public void setCatalogName(String catalogName) {
    this.catalogName = catalogName;
  }

  public String getReleaseTitle() {
    return releaseTitle;
  }

  public void setReleaseTitle(String releaseTitle) {
    this.releaseTitle = releaseTitle;
  }

  public Date getReleaseDate() {
    return releaseDate;
  }

  public void setReleaseDate(Date releaseDate) {
    this.releaseDate = releaseDate;
  }

  public String getReleaser() {
    return releaser;
  }

  public void setReleaser(String releaser) {
    this.releaser = releaser;
  }

  public Integer getReleaseStatus() {
    return releaseStatus;
  }

  public void setReleaseStatus(Integer releaseStatus) {
    this.releaseStatus = releaseStatus;
  }

  public Integer getCheckerStatus() {
    return checkerStatus;
  }

  public void setCheckerStatus(Integer checkerStatus) {
    this.checkerStatus = checkerStatus;
  }

  public String getEditStatus() {
    return editStatus;
  }

  public void setEditStatus(String editStatus) {
    this.editStatus = editStatus;
  }

  public String getSecretLevelName() {
    return secretLevelName;
  }

  public void setSecretLevelName(String secretLevelName) {
    this.secretLevelName = secretLevelName;
  }

  public String getCreatedName() {
    return createdName;
  }

  public void setCreatedName(String createdName) {
    this.createdName = createdName;
  }

  public String getDbid_() {
    return dbid_;
  }

  public void setDbid_(String dbid_) {
    this.dbid_ = dbid_;
  }

  public String getActivityalias_() {
    return activityalias_;
  }

  public void setActivityalias_(String activityalias_) {
    this.activityalias_ = activityalias_;
  }

  public String getActivityname_() {
    return activityname_;
  }

  public void setActivityname_(String activityname_) {
    this.activityname_ = activityname_;
  }

  public String getBusinessstate_() {
    return businessstate_;
  }

  public void setBusinessstate_(String businessstate_) {
    this.businessstate_ = businessstate_;
  }

  public String getProcessId() {
    return processId;
  }

  public void setProcessId(String processId) {
    this.processId = processId;
  }

  public String getReplyProcessId() {
    return replyProcessId;
  }

  public void setReplyProcessId(String replyProcessId) {
    this.replyProcessId = replyProcessId;
  }

  public String getLabelNames() {
    return labelNames;
  }

  public void setLabelNames(String labelNames) {
    this.labelNames = labelNames;
  }

  public String getReleaseScopeShowName() {
    return releaseScopeShowName;
  }

  public void setReleaseScopeShowName(String releaseScopeShowName) {
    this.releaseScopeShowName = releaseScopeShowName;
  }

  public String getProjectId() {
    return projectId;
  }

  public void setProjectId(String projectId) {
    this.projectId = projectId;
  }

  public Long getViewCount() {
    return viewCount;
  }

  public void setViewCount(Long viewCount) {
    this.viewCount = viewCount;
  }

  public Long getCallCount() {
    return callCount;
  }

  public void setCallCount(Long callCount) {
    this.callCount = callCount;
  }

  public String getEffectiveTimeTypeStr() {
    return effectiveTimeTypeStr;
  }

  public void setEffectiveTimeTypeStr(String effectiveTimeTypeStr) {
    this.effectiveTimeTypeStr = effectiveTimeTypeStr;
  }

  public String getSourceSystemName() {
    return sourceSystemName;
  }

  public void setSourceSystemName(String sourceSystemName) {
    this.sourceSystemName = sourceSystemName;
  }

  public String getReportUrl() {
    return reportUrl;
  }

  public void setReportUrl(String reportUrl) {
    this.reportUrl = reportUrl;
  }

  public String getCreateDeptName() {
    return createDeptName;
  }

  public void setCreateDeptName(String createDeptName) {
    this.createDeptName = createDeptName;
  }

  public String getReleaseDeptName() {
    return releaseDeptName;
  }

  public void setReleaseDeptName(String releaseDeptName) {
    this.releaseDeptName = releaseDeptName;
  }

  @Override
  public String getSecretLevel() {
    return secretLevel;
  }

  @Override
  public void setSecretLevel(String secretLevel) {
    this.secretLevel = secretLevel;
  }

  public String getLogFormName() {
    if (StringUtils.isEmpty(super.logFormName)) {
      return "数据资产模块";
    } else {
      return super.logFormName;
    }
  }

  public String getLogTitle() {
    if (StringUtils.isEmpty(super.logTitle)) {
      return "数据资产";
    } else {
      return super.logTitle;
    }
  }
}
